<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:25:"themes\article\index.html";i:1533287229;s:26:"themes\\header\header.html";i:1533108540;s:24:"themes\\right\right.html";i:1533107020;s:26:"themes\\footer\footer.html";i:1531447129;}*/ ?>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?php echo $article['title']; ?>-<?php echo $site_config['site_title']; ?></title>
	<meta name="keywords" content="<?php echo $site_config['seo_keyword']; ?>">
	<meta name="description" content="<?php echo $site_config['seo_description']; ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="icon" type="image/x-icon" href="/80629093830.png" />
	<link href="__public__css/base.css" rel="stylesheet">
	<link href="__public__css/index.css" rel="stylesheet">
	<link href="__public__css/info.css" rel="stylesheet">
	<link href="__public__css/m.css" rel="stylesheet">
	<link href="__public__css/share.min.css" rel="stylesheet">
	<link href="__public__css/common.css" rel="stylesheet">
	<link rel="stylesheet" href="/public/static/layui/css/layui.css" media="all">
	<style>
		code {
			display: inline-block;
			background-color: #f1f1f1;
			border-radius: 3px;
			padding: 3px 5px;
			margin: 0 3px;
		}
	</style>
</head>
<body>
<header class="header-navigation slideDown" id="header">
	<nav>
		<div class="logo"><a href="/"><h4 style="font-weight: bold;color: #0A8EE2">MaTie  Blog</h4></a></div>
		<h2 id="mnavh"><span class="navicon"></span></h2>
		<ul id="starlist">
			<li<?php if(strtoupper(strlen($currenturl)) == '1'): ?> class="l_active"<?php endif; ?>><a href="/">首页</a></li>
			<?php if(is_array($nav) || $nav instanceof \think\Collection): if( count($nav)==0 ) : echo "" ;else: foreach($nav as $key=>$vo): ?>
			<li <?php if(strstr($currenturl,$vo['link']))echo' id="selected"' ?>>
			<a href="/<?php echo $vo['link']; ?>"><?php echo $vo['name']; ?></a>
			</li>
			<?php endforeach; endif; else: echo "" ;endif; ?>
		</ul>
		<div class="searchbox">
			<div id="search_bar" class="search_bar">
				<form id="searchform" action="/index/so/index.html" method="get" >
					<input class="input" placeholder="想搜点什么呢.." name="key" id="keyboard" type="text">
					<input name="Submit" value="搜索" type="hidden">
					<p class="search_ico"> <span></span></p>
				</form>
			</div>
		</div>
	</nav>
</header>
<article>
	<main>
		<div class="infosbox">
			<div class="newsview">
				<h3 class="news_title"><?php echo $article['title']; ?></h3>
				<div class="bloginfo">
					<ul>
						<li class="author">
							作者：<?php echo $article['author']; ?></li>
						<li class="lmname">码铁博客</li>
						<li class="timer"><?php echo $article['publish_time']; ?></li>
						<li class="view">(<?php echo $article['reading']; ?>)人已阅读</li>
					</ul>
				</div>
				<div class="tags">
					<?php if($em != 1): if(is_array($k_tags) || $k_tags instanceof \think\Collection): if( count($k_tags)==0 ) : echo "" ;else: foreach($k_tags as $key=>$vo): ?>
						<a href="/index/so/index.html?key=<?php echo $vo['ta_name']; ?>" target="_blank"><?php echo $vo['ta_name']; ?></a> &nbsp;
						<?php endforeach; endif; else: echo "" ;endif; endif; ?>
				</div>
				<br/>
				<div class="news_content">
					<?php echo $article['content']; ?>
				</div>
				<div class="share">
					<div id="share" class="social-share" data-disabled="google,twitter,facebook,diandian"></div>
				</div>
			</div>
			</div>
			<div class="nextinfo">
				<p>上一篇：<?php echo !empty($prevs['title'])?'<a href="'.url('article/index','id='.$prevs['id']).'">'.$prevs['title'].'</a>' : '没有了'; ?></p>
				<p>下一篇：<?php echo !empty($nexts['title'])?'<a href="'.url('article/index','id='.$nexts['id']).'">'.$nexts['title'].'</a>' : '没有了'; ?></p>
			</div>
			<div class="news_pl">
				<div style="width:100px;float: left"><h2>文章评论</h2></div>
				<div class="reply-comments"><a href="javascript:;" onclick="test(<?php echo $article['id']; ?>,0,0)"><h2>评论</h2></a></div>
				<div style="clear: both"></div>
				<div id="dialogBg"></div>
				<div id="dialog" class="animated">
					<div class="dialogTop">
						<a href="javascript:;" class="claseDialogBtn">关闭</a>
					</div>
					<form action="" method="post" id="editForm">
						<input type="hidden" name="id" id="a_id" value="">
						<input type="hidden" name="p_id" id="p_id" value="">
						<input type="hidden" name="s_id" id="s_id" value="">
						<ul class="editInfos">
							<li><label>留言</label>&nbsp;&nbsp;<textarea name="content" id="content" cols="60" rows="5" class="ipt-area"></textarea></li>
							<li><label>昵称</label>&nbsp;&nbsp;<input type="text" name="nickname" id="name" required value="" class="ipt" /></li>
							<li><label>邮箱</label>&nbsp;&nbsp;<input type="text" name="email" id="email" value="" class="ipt" /></li>
							<li><input type="button" value="提交" class="submitBtn" id="submitBtn" /></li>
						</ul>
					</form>
				</div>
				<div class="gbko">
					<?php if(is_array($comment_list) || $comment_list instanceof \think\Collection): if( count($comment_list)==0 ) : echo "" ;else: foreach($comment_list as $key=>$vo): ?>
					<div class="comment">
						<div class="imgdiv">
							<img class="imgcss"  src="__public__images/timg.jpg"/>
							<!--<!--<div class="imgcss" style="background-color:black;"></div>-->
						</div>
						<div class="conmment_details">
							<div style="float:left;">
								<span class="comment_name"><?php echo $vo['nickname']; ?> </span>     &nbsp;<span><?php echo $vo['pub_time']; ?></span>

							</div>
							<div class="del">
								<span  class="show_reply_list"><a href="javascript:;" onclick="test(<?php echo $article['id']; ?>,<?php echo $vo['id']; ?>,<?php echo $vo['id']; ?>)">回复</a></span>
							</div>
							<div class="comment_content" >
								<?php echo $vo['content']; ?>
							</div>
						</div>
						<div class="reply_list">
							<?php if(is_array($vo['user']) || $vo['user'] instanceof \think\Collection): if( count($vo['user'])==0 ) : echo "" ;else: foreach($vo['user'] as $key=>$kk): ?>
							<div class="reply" >
								<div class="imgdiv">
									<img class="imgcss"  src="__public__images/timg.jpg"/>
								</div>
								<div class="ff_conmment_details">
									<div style="float:left;">
										<span class="comment_name"><?php echo $kk['nickname']; ?> </span>     &nbsp;<span><?php echo $kk['pub_time']; ?></span>

									</div>
									<div class="del">
										<span  class="show_reply_list"><a href="javascript:;" onclick="test(<?php echo $article['id']; ?>,<?php echo $kk['id']; ?>,<?php echo $vo['id']; ?>)">回复</a></span>
									</div>
									<div class="reply_comment_content" >回复&nbsp;<span style="font-weight: bold"><?php echo $kk['user_name']; ?></span>&nbsp;:&nbsp;&nbsp;
										<?php echo $kk['content']; ?>
									</div>
								</div>
							</div>
							<?php endforeach; endif; else: echo "" ;endif; ?>
							<div class="reply"  style="display:none">
								<div class="imgdiv">
									<img class="imgcss"  src="__public__images/timg.jpg"/>
								</div>
								<div class="ff_conmment_details">
									<div style="float:left;">
										<span class="comment_name">小猪 </span>     &nbsp;<span>22分钟前</span>

									</div>
									<div class="del">
										<span  class="show_reply_list"><a href="javascript:;" onclick="test()">回复</a></span>
									</div>
									<div class="reply_comment_content" > 回复&nbsp;<span style="font-weight: bold">大白</span>&nbsp;: &nbsp;&nbsp;感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了，
										好棒感觉林感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了
									</div>
								</div>
							</div>
						</div>
					</div>
					<?php endforeach; endif; else: echo "" ;endif; ?>
			</div>
		</div>
	</main>
	<aside id="stickMe" style="position: static; left: auto; width: 1000px;" class="">
	<div class="r_box">
		<div class="fenlei" style="border: 1px solid #ddd">
			<i class="fa fa-bars"></i>
			<h2>随机文章</h2>
			<ul>
				<?php if(is_array($randarticle) || $randarticle instanceof \think\Collection): if( count($randarticle)==0 ) : echo "" ;else: foreach($randarticle as $i=>$vo): ?>
				<li><a href="https://www.yangqq.com/download/div/"><?php echo $vo['title']; ?> ( <?php echo $vo['reading']; ?> )</a></li>
				<?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</div>
		<div class="cloud" style="border: 1px solid #ddd">
			<i class="fa fa-bars"></i>
			<h2>标签云</h2>
			<ul>
				<?php if(is_array($tags) || $tags instanceof \think\Collection): if( count($tags)==0 ) : echo "" ;else: foreach($tags as $i=>$vo): ?>
				<a href="/index/so/index.html?key=<?php echo $vo['tagname']; ?>" target="_blank"><?php echo $vo['tagname']; ?></a>
				<?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</div>
		<div class="fenlei" style="border: 1px solid #ddd">
			<i class="fa fa-bars"></i>
			<h2>友情链接</h2>
			<ul>
				<?php if(is_array($links) || $links instanceof \think\Collection): if( count($links)==0 ) : echo "" ;else: foreach($links as $key=>$vo): ?>
				<li style="display: inline;float: left"><a href="<?php echo $vo['linkurl']; ?>" target="_blank" title="<?php echo $vo['linkname']; ?>"><?php echo $vo['linkname']; ?></a></li>
				<?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</div>
		<div class="guanzhu" style="border: 1px solid #ddd">
			<i class="fa fa-bars"></i>
			<h2>关注博主</h2>
			<ul>
				<img src="__public__images/timg.jpg">
			</ul>
			<ul>
				<li class="qq"><a href="#" target="_blank"><span>QQ号</span>1095013906</a></li>
				<li class="github"><a href="https://github.com/tiedong" target="_blank"><span>github</span>tiedong</a></li>
				<li class="mayun"><a href="https://gitee.com/tiedong" target="_blank"><span>码云</span>254733775@qq.com</a></li>
			</ul>
		</div>
	</div>
</aside>
</article>
<footer>
    <p>Design by <a href="http://www.yangqq.com/" target="_blank">MaTie</a> <a href="https://www.yangqq.com/">粤ICP备17136532号-1</a></p>
</footer>
<a href="#" class="cd-top">Top</a>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="__public__js/jquery.js"></script>
<script src="__public__js/jquery_002.js"></script>
<script src="__public__js/hc-sticky.js"></script>
<script src="__public__js/comm.js"></script>
<script src="__public__js/scrollReveal.js"></script>
<script src="__public__js/jquery.share.min.js"></script>
<script src="__public__js/social-share.min.js"></script>
<script src="__public__layer/layer.js"></script>
<!--[if lt IE 9]>
<script src="/skin/show/js/modernizr.js"></script>
<![endif]-->
<script type="text/javascript">
    $(function(){
        $('#share').share({sites: ['qzone', 'qq', 'weibo','wechat']});
    });


    var w,h,className;
    function getSrceenWH(){
        w = $(window).width();
        h = $(window).height();
        $('#dialogBg').width(w).height(h);
    }

    window.onresize = function(){
        getSrceenWH();
    }
    $(window).resize();
    function test(id,a_id,s_id) {
        $("#a_id").attr("value",id);
        $("#p_id").attr("value",a_id);
        $("#s_id").attr("value",s_id);
        getSrceenWH();
        w = $(".gbko").width();
        className = $(this).attr('class');
        $('#dialogBg').fadeIn(300);
        $('#dialog').removeAttr('class').addClass('animated '+className+'').fadeIn();
        $('#dialog').width(w)
    }
    $('.claseDialogBtn').click(function(){
        $('#dialogBg').fadeOut(500,function(){
            $('#dialog').addClass('bounceOutUp').fadeOut();
            $("#a_id").attr("value","");
            $("#p_id").attr("value","");
            $("#s_id").attr("value","");
        });
    });


    //评论内容
	$("#submitBtn").click(function () {

        var _id      =  $("#a_id").val();
        var _pId     =  $("#p_id").val();
        var _sId     =  $("#s_id").val();
        var _content =  $("#content").val();
        var _name    =  $("#name").val();
        var _email   =  $("#email").val();
        /*if ( (_content=="") && (_name=="") ) {
            layer.msg('留言内容或者昵称不能为空！');
            return false;
		}*/
        var name =( _name != "")?_name:"匿名";
        $.ajax({
			type : "POST",
			url : "<?php echo url('gb/add'); ?>",
			data : {a_id:_id,content:_content,nickname:name,email:_email,p_id:_pId,s_id:_sId},
			success : function (res) {
				if ( res==1 ) {
                    layer.msg('评论成功！');
                    $('#dialogBg').fadeOut(500,function(){
                        $('#dialog').addClass('bounceOutUp').fadeOut();
                        $("#a_id").attr("value","");
                        $("#p_id").attr("value","");
                        $("#s_id").attr("value","");
                    });
                    window.location.reload();
				} else {
                    layer.msg('评论失败！');
				}
            }
		});
    });

</script>
</body>
</html>
